<template>
	<view>
		<view class="head">
			<image src="../../static/images/arrow_left.png" mode="" @click="goo"></image>
			<view class="">导出历史记录</view>
			<view class="f32" @click="shu">刷新</view>
		</view>

		<view class="box" v-for="item in arry" :key="item.log_id">
			<view class="box-l">
				<view class="f32 ca">{{item.log_title.split('(')[0]}}</view>
				<view class="dx" style="color: #666666;">{{ item.log_title }}</view>
			</view>
			<view class="dow" @click="dow(item)">下载</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			arry: '',
			log_id: '',
			log_title:''
		};
	},
	onLoad() {
		this.show();
	},
	methods: {
		dow(e) {
			this.log_id = e.log_id;
		const	that=this
			uni.showModal({
				title: '下载完成',
				content: '是否导出'+e.log_title,
				success: function(res) {
					if (res.confirm) {
						that.$ajax('api/v1.export/download',{
						   log_id:that.log_id 
						       }).then((res)=>{
						      console.log(res);
						       }).catch(res=>{
						        console.log(Error);
						       })
					} else if (res.cancel) {
						console.log('用取消');
					}
				}
			});
		},
		show() {
			this.$ajax('api/v1.export/log', {})
				.then(res => {
					// console.log(res);
					this.arry = res.result;
					console.log(this.arry);
				})
				.catch(res => {
					console.log(Error);
				});
		},
		shu(){
			this.show();
		},
		goo(){
			uni.navigateTo({
				url:'educe'
			})
		}
	}
};
</script>

<style lang="scss">
page {
	background-color: #f7f4f8;
}
.head {
	
	background-color: #249af6;
	color: #ffffff;
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	padding: 60upx 30upx 30upx;
	font-size: 36rpx;
	font-family: PingFang SC;
	font-weight: 500;
	margin-bottom: 30rpx;
	image {
		width: 22rpx;
		height: 39rpx;
	}
}
.dx{
	font-size: 25rpx;
}
.box {
	margin-top: 20rpx;
	height: 156rpx;
	background-color: #ffffff;
	display: flex;
	padding: 0 30rpx;
	justify-content: space-between;
	.dow {
		margin-top: 61rpx;
		color: #249af6;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
	}
	.box-l {
		.ca {
			margin-top: 38rpx;
			margin-bottom: 21rpx;
		}
	}
}
</style>
